<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button onclick="clk()">点击</button>
</body>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
    function clk() {
        $.ajax({
            url:'getVal',
            method:'get',
            success:function(a){
                console.log(a);
            }
        })
    }
</script>
</html>